<template>
  <div>
    <van-nav-bar title="试题选择" left-text="返回" @click-left="onClickLeft" left-arrow :style="rgba[0]" />
    <div v-for="(item,i) of arrId" :key="i">
      <div v-for="(itmes,j) of choice_data" :key="j">
        <template v-if="item==itmes.quiz_list_id">
          <van-cell :title="itmes.quiz_title" is-link @click="fn(item)" />
        </template>
      </div>
    </div>
  </div>
</template>

<script>
//选择试题
import { createNamespacedHelpers } from "vuex";
const { mapState } = createNamespacedHelpers("apiDataModules");
export default {
  name: "choice",
  props: {
    arrId: Array,
  },
  data(){
    return{
      choice_data:{},
      rgba:{},
    }
  },
  mounted(){
    this.choice_data = this.apidatas.all_quiz_list
    this.rgba = JSON.parse(localStorage.getItem("bakcColor"))
  },
  computed: {
    ...mapState(["apidatas"]),
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    fn(id){
      this.$router.push({path:"/examin",query:{id:id}})
    }
  }
};
</script>

<style lang="scss" scoped>
@import "@/style/choice/choice.scss";
</style>